package com.jj.service.room;

import com.jj.battle.protocol.GameProto;
import com.jj.entity.RecorderManager;
import com.jj.protocol.RoomStatus;
import com.jj.service.Ticker;
import com.jj.service.entity.Entity;
import com.jj.service.player.Player;

import java.util.List;

/**
 * Copyrights: QidianGroup@JJ
 *
 * @author: LuHan
 * @date: 2018/1/15, 16:00
 */
public interface Room extends Entity, Ticker {
    boolean join(Player player);
    void leave(Player player);
    void leave(long uid);
    void synState(int beginSeq, Player player);
    RoomState getState();

    RecorderManager getRecorderManager();

    void processCmd(Long uid, GameProto.PKG_OPERATION cmd);

    List<Player> getPlayers();

    RoomStatus getStatus();

    int size();

    void setPlayerA(long playerA);
    void setPlayerB(long playerB);
    long getPlayerA();
    long getPlayerB();

    void heartbeat();

    boolean needStop();
    void stop();

    GameProto.PKG_VERIFY buildVerify();
}
